﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Novice.Units.Test
{
    class UnitMocks
    {
        #region private data

        private readonly Tree.Unit _gramm;
        private readonly Tree.Unit _kilogramm;
        private readonly Tree.Unit _miligramm;
        
        private readonly Tree.Unit _liter;
        private readonly Tree.Unit _mililiter;
        private readonly Tree.Unit _bigCup;
        private readonly Tree.Unit _teaspoon;
        private readonly Tree.Unit _smallCup;
        private readonly Tree.Unit _tableSpoon;

        private readonly Tree.Unit _piece;

        #endregion

        public UnitMocks()
        {
            _piece = new Tree.Unit {Name = "Шт"};

            _gramm = new Tree.Unit {Name = "г"};
            _kilogramm = new Tree.Unit
                         {
                             BaseUnit = _gramm,
                             Coefficient = 1000.0,
                             Name = "кг"
                         };
            _miligramm = new Tree.Unit
                         {
                             BaseUnit = _gramm,
                             Coefficient = 1.0/1000.0,
                             Name = "мг"
                         };

            _liter = new Tree.Unit {Name = "л"};
            _mililiter = new Tree.Unit
            {
                BaseUnit = _liter,
                Coefficient = 1.0/1000.0,
                Name = "мл"
            };
            _bigCup = new Tree.Unit
            {
                BaseUnit = _mililiter,
                Coefficient = 250.0,
                Name = "б.кружка"
            };
            _smallCup = new Tree.Unit
            {
                BaseUnit = _mililiter,
                Coefficient = 200.0,
                Name = "м.кружка"
            };
            _tableSpoon = new Tree.Unit
            {
                BaseUnit = _mililiter,
                Coefficient = 18.0,
                Name = "ст.л"
            };
            _teaspoon = new Tree.Unit
            {
                BaseUnit = _mililiter,
                Coefficient = 5.0,
                Name = "ч.л"
            };
        }

        public Tree.Unit Piece
        {
            get { return _piece; }
        }
        
        public Tree.Unit Gramm
        {
            get { return _gramm; }
        }
        public Tree.Unit Kilogramm
        {
            get { return _kilogramm; }
        }
        public Tree.Unit Miligramm
        {
            get { return _miligramm; }
        }

        public Tree.Unit Liter
        {
            get { return _liter; }
        }
        public Tree.Unit Mililiter
        {
            get { return _mililiter; }
        }
        public Tree.Unit BigCup
        {
            get { return _bigCup; }
        }
        public Tree.Unit SmallCup
        {
            get { return _smallCup; }
        }
        public Tree.Unit TableSpoon
        {
            get { return _tableSpoon; }
        }
        public Tree.Unit TeaSpoon
        {
            get { return _teaspoon; }
        }

    }
}
